<template>
  <div>
    <!-- 面包屑 -->
    <div class="box">
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item>订单管理</el-breadcrumb-item>
        <el-breadcrumb-item>订单列表</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <!-- 表格 -->
    <template>
      <div style="margin-top: 15px">
        <el-input
          placeholder="请输入内容"
          v-model="input3"
          class="input-with-select"
        >
          <el-button slot="append" icon="el-icon-search"></el-button>
        </el-input>
      </div>
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column type="index" label="#"> </el-table-column>
        <el-table-column prop="order_number" label="订单编号"  width="180px">
        </el-table-column>
        <el-table-column prop="order_price" label="订单价格" width="100px">
        </el-table-column>
        <el-table-column prop="is_send" label="是否付款" width="100px"> </el-table-column>
        <el-table-column prop="pay_status" label="是否发货" width="100px"> </el-table-column>
        <el-table-column prop="create_time" label="下单时间"> </el-table-column>
        <el-table-column prop="cz" label="操作">
          <el-button type="primary" @click="bj">地址选择</el-button>
          <el-button type="success">物流信息</el-button>
        </el-table-column>
      </el-table>
    </template>
    <!-- 分页 -->
    <div class="block">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="pageIfo.pagenum"
      :page-sizes="[5, 10, 15, 20]"
      :page-size="pageIfo.pagesize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="this.total">
    </el-pagination>
  </div>
  <!-- 地区选择弹出框 -->
  <el-dialog title="收货地址" :visible.sync="dialogFormVisible">
  <el-form :model="form">
    <el-form-item label="活动名称" :label-width="formLabelWidth">
      <el-input v-model="form.name" autocomplete="off"></el-input>
    </el-form-item>
    <div class="block">
  <span class="demonstration">详细地址</span>
  <el-cascader
    v-model="value"
    :options="options"
    @change="handleChange" ></el-cascader>
</div>
  </el-form>
  <div slot="footer" class="dialog-footer">
    <el-button @click="dialogFormVisible = false">取 消</el-button>
    <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
  </div>
  </el-dialog>
  </div>
</template>
<script>
import { getorder,getkuaidi } from "../Api/index";
// import { createApp } from 'vue';
// import { Cascader } from 'vant';
export default {
  data() {
    return {
        dialogFormVisible:false,
        options:[],
      input3: "",
      tableData: [],
      value:'',
      page: {
        query: "",
        pagenum: 1,
        pagesize: 10,
      },
      total:0,
      pageIfo:{
        pagenum:1,
        pagesize:10
      },
      form:{
        name:''
      },
      formLabelWidth: '120px'
    };
  },
  created() {
    this.getlist();
    this.getkuaidis()
  },
  methods: {
    //列表
    async getlist() {
      let res = await getorder();
      console.log(res);
      this.tableData = res.data.goods;
      this.total=res.data.total
    },
    //物流信息
    async getkuaidis(){
        let res=await getkuaidi()
        console.log(res);
    },
    handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
    },
     handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
    },
    bj(){
        this.dialogFormVisible=true
    },
    handleChange(){

    }
  },
   filters: {
    filterstime(val) {
      let times = new Date(val * 1000).toLocaleString();
      return times;
    },
  },
};
</script>
<style lang="scss" scoped>
.input-with-select {
  width: 400px;
  margin-left: -880px;
}
</style>